Inability to delete Discussion via dxl - SOLVED

Sorry for the multiple threads on this issue, but for reasons that are beyond me, the forum will not let me reply to any threads I've created, regardless of whether they are created as simple discussions or as questions.

As previously stated, I could not employ the dxl delete function provided on pages 34 and 820 of the 9.2 dxl Reference Manual to delete a Discussion

Declaration
string delete (Discussion& d)

To wit:

Module m = current
Object o = current
string sResult
Discussion disc = null
for disc in o do {
  print "Discussion summary ; " disc.summary "\n"
  sResult = delete(disc)
}


results in -E- DXL: <Line:7> incorrect arguments for function (delete)
Further poking around has revealed that the function should actually be declared as:

string deleteDiscussion(Discussion& d, Object o)

The following will indeed delete all discussions for the current object:

 

Module m = current
Object o = current
string sResult
Discussion disc = null
for disc in o do {
  print "Discussion summary ; " disc.summary "\n"
    print "Deleting discussion ; " disc.summary "\n"
    sResult = deleteDiscussion(disc, o)
}



I do still hope that someone can explain the & in Discussion& and in Comment& in the various Discussion declarations.



 


dedawson - Mon May 09 11:16:17 EDT 2011

Re: Inability to delete Discussion via dxl - SOLVED
llandale - Mon May 09 12:28:34 EDT 2011

The ampersand & character means "call by reference" (rather than "call by value") and has the implication that the function intends to modify that parameter.

string deleteDiscussion(Discussion& d, Object o)

In this case its pretty clear that the function intends to set "d" to null after deleting the Discussion.

  • Louie